package com.yili.oa.dao;

import com.yili.oa.models.LotteryDrawConfig;
import com.yili.oa.models.LotteryDrawConfigExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface LotteryDrawConfigMapper {
    @SelectProvider(type=LotteryDrawConfigSqlProvider.class, method="countByExample")
    long countByExample(LotteryDrawConfigExample example);

    @DeleteProvider(type=LotteryDrawConfigSqlProvider.class, method="deleteByExample")
    int deleteByExample(LotteryDrawConfigExample example);

    @Delete({
        "delete from ft_lottery_draw_config",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into ft_lottery_draw_config (id, award, ",
        "odds, create_time)",
        "values (#{id,jdbcType=BIGINT}, #{award,jdbcType=VARCHAR}, ",
        "#{odds,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT})"
    })
    int insert(LotteryDrawConfig record);

    @InsertProvider(type=LotteryDrawConfigSqlProvider.class, method="insertSelective")
    int insertSelective(LotteryDrawConfig record);

    @SelectProvider(type=LotteryDrawConfigSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="award", property="award", jdbcType=JdbcType.VARCHAR),
        @Result(column="odds", property="odds", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.BIGINT)
    })
    List<LotteryDrawConfig> selectByExample(LotteryDrawConfigExample example);

    @Select({
        "select",
        "id, award, odds, create_time",
        "from ft_lottery_draw_config",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="award", property="award", jdbcType=JdbcType.VARCHAR),
        @Result(column="odds", property="odds", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.BIGINT)
    })
    LotteryDrawConfig selectByPrimaryKey(Long id);

    @UpdateProvider(type=LotteryDrawConfigSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") LotteryDrawConfig record, @Param("example") LotteryDrawConfigExample example);

    @UpdateProvider(type=LotteryDrawConfigSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") LotteryDrawConfig record, @Param("example") LotteryDrawConfigExample example);

    @UpdateProvider(type=LotteryDrawConfigSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(LotteryDrawConfig record);

    @Update({
        "update ft_lottery_draw_config",
        "set award = #{award,jdbcType=VARCHAR},",
          "odds = #{odds,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(LotteryDrawConfig record);
}